﻿namespace Probel.NDoctor.Statistics.Console.Commands
{
    using System;

    using Probel.NDoctor.Statistics.Console.Menus;

    internal abstract class Command : ICommand
    {
        #region Methods

        public void Execute()
        {
            try
            {
                this.SafeExecute();
            }
            catch (Exception ex)
            {
                Output.EmptyLine();
                Output.WriteLine(ex.ToString());
            }

            Output.Pause();
        }

        protected abstract void SafeExecute();

        #endregion Methods
    }
}